package bob.project.object;

public abstract class LiveObject extends MovableObject
{
	public int hp = 100;
	public int maxHp = 100;
	protected boolean isDead = false;
	protected long timeOfDeath;
	protected long reload = System.currentTimeMillis();
	protected long reloadTime = 500L;
	public abstract void die();
	
	
	public void hit(int damage, LiveObject owner)
	{
		hp -= damage;
		if (hp < 0)
			hp = 0;
		if (hp == 0)
			die();
		System.out.println(this);
	}
	
	protected void jump()
	{
		onGround = false;
		ySpeed = -256f;
	}
}
